package com.electric.electric.controller;

import com.electric.electric.POJO.DTO.SecondaryIndicatorDTO;
import com.electric.electric.service.SecondaryIndicatorService;
import com.electric.electric.POJO.VO.SecondaryIndicatorVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/secondary-indicators")
public class SecondaryIndicatorController {

    @Autowired
    private SecondaryIndicatorService secondaryIndicatorService;

    @GetMapping
    public SecondaryIndicatorVO getAllIndicators() {
        List<SecondaryIndicatorDTO> indicators = secondaryIndicatorService.getAllSecondaryIndicators();
        SecondaryIndicatorVO vo = new SecondaryIndicatorVO();
        vo.setSecondaryIndicators(indicators);
        return vo;
    }
}